package com.lingxu.module.earlyWarn.controller;

import com.lingxu.base.common.api.vo.Result;
import com.lingxu.module.earlyWarn.service.CockpitService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
* @Description: 驾驶舱
* @Author: 金飞翔
*/
@Slf4j
@Api(tags="驾驶舱")
@RestController
@RequestMapping("/cockpit")
public class CockpitController {

   @Resource
   private CockpitService cockpitService;

   /**
    * @Author
    * @Description 预警总体情况
    * @Date 2024/4/11 17:01
    * @Param
    * @return
    **/
   @ApiOperation(value="预警总体情况")
   @PostMapping(value = "/warningSituation")
   public Result warningSituation(String region) {
      return cockpitService.warningSituation(region);
   }

   /**
    * @Author
    * @Description 预警领域分布
    * @Date 2024/4/11 17:03
    * @Param
    * @return
    **/
   @ApiOperation(value="预警领域分布")
   @PostMapping(value = "/warningFieldDistribution")
   public Result warningFieldDistribution(String region) {
      return cockpitService.warningFieldDistribution(region);
   }

   /**
    * @Author
    * @Description 预警地域分布
    * @Date 2024/4/11 17:08
    * @Param
    * @return
    **/
   @ApiOperation(value="预警地域分布")
   @PostMapping(value = "/warningAreaDistribution")
   public Result warningAreaDistribution(String region) {
      return cockpitService.warningAreaDistribution(region);
   }

   /**
    * @Author
    * @Description 高频问题
    * @Date 2024/4/11 19:22
    * @Param
    * @return
    **/
   @ApiOperation(value="高频问题")
   @PostMapping(value = "/highFrequencyIssues")
   public Result highFrequencyIssues(String region) {
      return cockpitService.highFrequencyIssues(region);
   }

   /**
    * @Author
    * @Description 实时预警-驾驶舱1
    * @Date 2024/4/11 19:23
    * @Param
    * @return
    **/
   @ApiOperation(value="实时预警")
   @PostMapping(value = "/findModelIssueList")
   public Result findModelIssueList(String region) {
      return cockpitService.findModelIssueList(region);
   }

   /**
    * @Author
    * @Description 模型类型分布
    * @Date 2024/4/12 11:31
    * @Param
    * @return
    **/
   @ApiOperation(value="模型类型分布")
   @PostMapping(value = "/modelTypeDistribution")
   public Result modelTypeDistribution(String year) {
      return cockpitService.modelTypeDistribution(year);
   }

   /**
    * @Author
    * @Description 模型地区分布
    * @Date 2024/4/12 13:54
    * @Param
    * @return
    **/
   @ApiOperation(value="模型地区分布")
   @PostMapping(value = "/modelAreaDistribution")
   public Result modelAreaDistribution(String year) {
      return cockpitService.modelAreaDistribution(year);
   }

   /**
    * @Author
    * @Description 时间趋势
    * @Date 2024/4/12 15:00
    * @Param
    * @return
    **/
   @ApiOperation(value="时间趋势")
   @PostMapping(value = "/timeTrend")
   public Result timeTrend(String year) {
      return cockpitService.timeTrend(year);
   }

   /**
    * @Author
    * @Description 模型领域分布
    * @Date 2024/4/12 16:03
    * @Param
    * @return
    **/
   @ApiOperation(value="模型领域分布")
   @PostMapping(value = "/modelfieldDistribution")
   public Result modelfieldDistribution(String year) {
      return cockpitService.modelfieldDistribution(year);
   }

   /**
    * @Author
    * @Description 模型列表
    * @Date 2024/4/12 16:15
    * @Param
    * @return
    **/
   @ApiOperation(value="模型列表")
   @PostMapping(value = "/modelList")
   public Result modelList(String year) {
      return cockpitService.modelList(year);
   }

   /**
    * @Author
    * @Description 实时预警-驾驶舱4
    * @Date 2024/4/12 16:18
    * @Param
    * @return
    **/
   @ApiOperation(value="实时预警")
   @PostMapping(value = "/realTimeWarning")
   public Result realTimeWarning(String year) {
      return cockpitService.realTimeWarning(year);
   }
   /**
    * @Author
    * @Description 乡镇排行
    * @Date 2024/4/12 17:08
    * @Param
    * @return
    **/
   @ApiOperation(value="乡镇排行")
   @PostMapping(value = "/townshipRanking")
   public Result townshipRanking(String year) {
      return cockpitService.townshipRanking(year);
   }

   /**
    * @Author
    * @Description 比较数量
    * @Date 2024/4/12 17:55
    * @Param
    * @return
    **/
   @ApiOperation(value="比较数量")
   @PostMapping(value = "/compareCounts")
   public Result compareCounts(String year) {
      return cockpitService.compareCounts(year);
   }

   /**
    * @Author
    * @Description 监督成果
    * @Date 2024/4/12 19:30
    * @Param
    * @return
    **/
   @ApiOperation(value="监督成果")
   @PostMapping(value = "/listenResults")
   public Result listenResults(String region) {
      return cockpitService.listenResults(region);
   }
}
